<% event_form = fields %>
<tr>
	<td class="label_cell_form"><%= label_tag "event_name", Core.human_attribute_name("name") %></td>
	<td class="label_input_form">
		<%= event_form.text_field :name %>
		<div class="mini_tip"><span><%= I18n.t("event.example") %></span></div>
		<%= less_reverse_captcha_field :event %>
		<%= event_form.hidden_field :eid %>
		
	</td>
</tr>
<tr>
	<td class="label_cell_form"><%= label_tag "event_date", Event.human_attribute_name("date") %></td>
	<td class="label_input_form">
			<div class="left">
				<div class="mini_label" id="label_from_date" <%= "style='display:none'" if @event.date_end.to_s != "" %>><span>From</span></div>
				<%= event_form.text_field :date, :value => I18n.localize(@event.date), :class => "calendar" %>
			</div>
			<div class="left" id="date_end_field_div" <%= "style='display:none'" if @event.date_end.to_s != "" %>>
				<div class="mini_label"><span>To</span></div>
					<%= event_form.text_field :date_end, 
							:value => I18n.localize(@event.date_end), :class => "calendar", :style => "width:126px"  %>
			</div>
			<div id="more_days_container" >
				<span id="more_days" onclick="more_days_click();" class="mini_button_form">more days</span>
			</div>
			<div class="separator"><span></span></div>			
			<div id="more_days_div" <%= "style='display:none'" if @event.date_end.to_s != "" %>>										
				<div id="days_of_week_field_div">						
					<a href="javascript:clickAllDays();" id="day_of_week_8" class="mini_button_form<%= " mini_button_form_clicked" if @event.days_of_week.to_s == "" %>">daily</a><%
					 for i in 0..6 
					%><a href="javascript:clickDayOfWeek(<%= i %>);" id="day_of_week_<%= i %>" class="mini_button_form"><%= I18n.t('date.abbr_day_names')[i].downcase %></a><%
					 end %>						
					<%= event_form.hidden_field :days_of_week%>
				</div>				
			</div>		
			
			<div id="part_of_day_field_div">
				<a  href="#" id="event_all_day_lnk" onclick="return partOfDayClicked(this,5);" 
					class="mini_button_form<%= ' mini_button_form_clicked' if @event.part_of_day == '1111' %>"> 
					<%=t "event.all_day" -%>
				</a>
				<a href="#" onclick="return partOfDayClicked(this,1);" 
					class="mini_button_form<%= ' mini_button_form_clicked' if (@event.part_of_day != '1111' and @event.part_of_day[0] == '1') %>"> 
					<%=t "event.morning" -%>
				</a>
				<a href="#" onclick="return partOfDayClicked(this,2);" 	
					class="mini_button_form<%= ' mini_button_form_clicked' if (@event.part_of_day != '1111' and @event.part_of_day[1] == '1') %>"> 
					<%=t "event.afternoon" -%>
				</a>
				<a href="#" onclick="return partOfDayClicked(this,3);" 
					class="mini_button_form<%= ' mini_button_form_clicked' if (@event.part_of_day != '1111' and @event.part_of_day[2] == '1') %>">	
					<%=t "event.evening" -%>
				</a>				
				<a href="#" onclick="return partOfDayClicked(this,4);" 
					class="mini_button_form<%= ' mini_button_form_clicked' if (@event.part_of_day != '1111' and @event.part_of_day[3] == '1') %>">	
					<%=t "event.night" -%>
				</a>				
				<%= event_form.hidden_field :part_of_day -%>				
			</div>				
	</td>
</tr>
<tr>	
	<td class="label_cell_form"><%= label_tag "event_prices", Event.human_attribute_name("prices") %></td>
	<td class="label_input_form">
		<%= event_form.text_field :prices, :maxlength => 30 %>
		<div id="price_details_fields_div">
			<a  href="#" onclick="return chkClicked(this,'event_free_entry');" class="mini_button_form"> 
				<%= Event.human_attribute_name("free_entry").downcase -%>
			</a>
			<a href="#" onclick="return chkClicked(this,'event_with_drink');" class="mini_button_form"> 
				<%= Event.human_attribute_name("with_drink").downcase -%>
			</a>
			<a href="#" onclick="return chkClicked(this,'event_with_pass');" class="mini_button_form">	
				<%= Event.human_attribute_name("with_pass").downcase -%>
			</a>
			<%= event_form.check_box :free_entry -%>
			<%= event_form.check_box :with_drink -%>
			<%= event_form.check_box :with_pass -%>
		</div>		
		
	</td>
</tr>
<tr>
	<td class="label_cell_form"><%= label_tag "place_name", Event.human_attribute_name("place") %></td>
	<td class="label_input_form">
		<% event_form.fields_for :place_attributes, @event.place do |place_form| %>
				<div class="left">
					<div id="place_name_readable"<%= " style='display:block'" unless @event.place.new_record? %>><%= @event.place.name.to_s %></div>
					<div class="search_field" id="event_place_search_field" 
							<%="display:none" unless @event.place.new_record? %>>		
						<img src="/images/icon_search.png" alt="find" />			
						<%= place_form.text_field :name %>
						<div class="separator"><span></span></div>
					</div>
					<div class="mini_tip">
						<span id="event_place_autocomplete_tip"><%= I18n.t("place.autocomplete") %></span>
					</div>						
					<%= place_form.hidden_field :id %>
					<%= place_form.check_box :is_generic, :style => "display:none"  %>
					<div class="search_field" id="event_location_search_field" style='display:none'>		
						<img src="/images/icon_search.png" alt="find" />			
						<input type="text" name="event[place_attributes][location_name]" id="event_place_location_full_address" size="30" value="<%= @event_location %>" />
						<div class="separator"><span></span></div>
					</div>		
					<div class="mini_tip">			
						<span id="event_place_location_autocomplete_tip" style='display:none'><%= I18n.t("location.autocomplete") %></span>
					</div>		
				</div>								
   		<% end %>				
		<div id="generic_place_lnk" <%= " style='display:none'" unless @event.place.new_record? %> class="mini_button_form"><%=t "place.is_generic"%></div>		
		<div id="edit_place_lnk" <%= " style='display:block'" unless @event.place.new_record? %> onclick="changeInputPlace('event_place_attributes_name')" class="mini_button_form"><%=t "edit" %></div>
		<div style="clear:both;"><span></span></div>		
	</td>
</tr>
<tr>
	<td class="label_cell_form"><%= label_tag "artist_names", Event.human_attribute_name("artist_names") %></td>
	<td class="label_input_form">
		<div style="height:23px;">
			<div class="search_field" id="event_human_search_field">
				<img src="/images/icon_search.png" alt="find" />			
				<%= event_form.text_field :human_names, :style => @event.human_names.blank? ? "" : "display:none" %>
				<div class="separator"><span></span></div>
			</div>
		</div>		
		<%= event_form.hidden_field :human_ids %>		
		<div class="mini_tip"><span><%= I18n.t("human.autocomplete") %></span></div>
		<div id="human_names"></div>	
	</td>
</tr>
<tr>
	<td class="label_cell_form"><%= label_tag "event_kinds", Event.human_attribute_name("kinds") %></td>
	<td class="label_input_form kinds_cell_form">		
		<%= render :partial => "/cores/kinds_field", :object => { :core => @event, :form => event_form } %>	
	</td>
</tr>
<tr>
	<td class="label_cell_form"><%= label_tag "event_description", Core.human_attribute_name("description") %></td>
	<td class="label_input_form"><%= event_form.text_area :description, :rows => 5, :class => "tinymce" %></td>
</tr>
<tr>
	<td class="label_cell_form"><%= label_tag "event_sites", Core.human_attribute_name("sites") %></td>
	<td class="label_input_form">
  		<% sites = @event.sites.to_s.split(" , ") %>  		
		<div>
			<%= text_field_tag "event[site][]", sites.delete_at(0), :size => 30 %>
			<a rel="event" href="#" class="more_site_lnk mini_button_form" ><%=t "core.more_sites" %></a>
			<%= a = ""; sites.each{ |i| a += "<br />" + text_field_tag("event[site][]",i)}; a; %>
		</div>

	</td>
</tr>
<tr>
	<td class="label_cell_form"><%= label_tag "event_photo_data", Event.human_attribute_name("photo")  %></td>
	<td class="label_input_form">
		<%= render :partial => "/cores/image_field", :object => { :form => event_form, 
				:core_name => "event", :core_photo => @event_photo } %>		
	</td>	
</tr>
